Skip to content

fix(orchestrator-form-widgets): avoid ActiveTextInput crash when fetch:response:value resolves to missing key#3074

Merged
karthikjeeyar merged 4 commits into
redhat-developer:mainfrom
lokanandaprabhu:fix/orchestrator-active-textinput-missing-selector
May 11, 2026
Merged

fix(orchestrator-form-widgets): avoid ActiveTextInput crash when fetch:response:value resolves to missing key#3074
karthikjeeyar merged 4 commits into
redhat-developer:mainfrom
lokanandaprabhu:fix/orchestrator-active-textinput-missing-selector

Conversation

@lokanandaprabhu
Copy link
Copy Markdown
Member

Hey, I just made a Pull Request!

Fixes: https://redhat.atlassian.net/browse/RHDHBUGS-3110

This fixes a runtime failure path in ActiveTextInput when fetch:response:value (JSONata) resolves to undefined/null — common while editing dynamic selector keys with fetch:retrigger.

Screen.Recording.2026-05-08.at.12.15.43.PM.mov

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

…safely

Treat null or undefined JSONata results as empty string for ActiveTextInput fetch response values to avoid UI breakage while editing dynamic selector keys, and add tests for applySelectorString strict/lenient behavior.
@rhdh-gh-app
Copy link
Copy Markdown

rhdh-gh-app Bot commented May 8, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets workspaces/orchestrator/plugins/orchestrator-form-widgets patch v1.10.6

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 70.68966% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.96%. Comparing base (acfcb4c) to head (acf8bd4).
⚠️ Report is 14 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3074      +/-   ##
==========================================
+ Coverage   60.94%   60.96%   +0.01%     
==========================================
  Files        2067     2067              
  Lines       63931    63974      +43     
  Branches    16599    16598       -1     
==========================================
+ Hits        38965    38999      +34     
- Misses      24733    24739       +6     
- Partials      233      236       +3     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from 9d84ed2
ai-integrations 70.03% <ø> (ø) Carriedforward from 9d84ed2
app-defaults 69.60% <ø> (ø) Carriedforward from 9d84ed2
augment 69.36% <ø> (ø) Carriedforward from 9d84ed2
bulk-import 72.44% <ø> (ø) Carriedforward from 9d84ed2
cost-management 16.49% <ø> (ø) Carriedforward from 9d84ed2
dcm 32.85% <ø> (ø) Carriedforward from 9d84ed2
extensions 61.71% <ø> (ø) Carriedforward from 9d84ed2
global-floating-action-button 73.75% <ø> (ø) Carriedforward from 9d84ed2
global-header 61.68% <ø> (ø) Carriedforward from 9d84ed2
homepage 50.84% <ø> (ø) Carriedforward from 9d84ed2
konflux 91.01% <ø> (ø) Carriedforward from 9d84ed2
lightspeed 69.92% <ø> (ø) Carriedforward from 9d84ed2
mcp-integrations 81.59% <ø> (ø) Carriedforward from 9d84ed2
orchestrator 35.14% <70.68%> (+0.31%) ⬆️
quickstart 62.64% <ø> (ø) Carriedforward from 9d84ed2
sandbox 79.56% <ø> (ø) Carriedforward from 9d84ed2
scorecard 83.61% <ø> (ø) Carriedforward from 9d84ed2
theme 64.54% <ø> (ø) Carriedforward from 9d84ed2
translations 8.49% <ø> (ø) Carriedforward from 9d84ed2
x2a 82.09% <ø> (ø) Carriedforward from 9d84ed2

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acfcb4c...acf8bd4. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

lokanandaprabhu and others added 3 commits May 11, 2026 13:20
…g selectors

Wrap JSONata compile/evaluate in applySelector with clear errors and lenient
empty string/array fallbacks where already used for fetch responses. Skip
invalid jsonata: body fields in useRequestInit instead of failing the whole
request. Extend changeset and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
…l input

Coerce or empty non-string template results in evaluateFetchResponseSelectorTemplate,
treat non-string JSONata results as empty in lenient applySelector paths, and guard
SchemaUpdater object extraction. Update tests and changeset.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@karthikjeeyar karthikjeeyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally, handles the invalid inputs or partial JSON data and doesn't break the UI anymore.

/approve
/lgtm

@openshift-ci openshift-ci Bot added the lgtm label May 11, 2026
@karthikjeeyar karthikjeeyar merged commit a034e0e into redhat-developer:main May 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants